/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entidades;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author rafrau
 */
@Entity
@Table(name = "reg", catalog = "idlbbd", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Reg.findAll", query = "SELECT r FROM Reg r"),
    @NamedQuery(name = "Reg.findByIdReg", query = "SELECT r FROM Reg r WHERE r.idReg = :idReg"),
    @NamedQuery(name = "Reg.findByDateReg", query = "SELECT r FROM Reg r WHERE r.dateReg = :dateReg"),
    @NamedQuery(name = "Reg.findByLibReg", query = "SELECT r FROM Reg r WHERE r.libReg = :libReg"),
    @NamedQuery(name = "Reg.findByCapReg", query = "SELECT r FROM Reg r WHERE r.capReg = :capReg"),
    @NamedQuery(name = "Reg.findByVerReg", query = "SELECT r FROM Reg r WHERE r.verReg = :verReg"),
    @NamedQuery(name = "Reg.findByCaplReg", query = "SELECT r FROM Reg r WHERE r.caplReg = :caplReg"),
    @NamedQuery(name = "Reg.findByVerlReg", query = "SELECT r FROM Reg r WHERE r.verlReg = :verlReg"),
    @NamedQuery(name = "Reg.findByLiblReg", query = "SELECT r FROM Reg r WHERE r.liblReg = :liblReg"),
    @NamedQuery(name = "Reg.findByNomUsr", query = "SELECT r FROM Reg r WHERE r.nomUsr = :nomUsr")})
public class Reg implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_reg", nullable = false)
    private Integer idReg;
    @Basic(optional = false)
    @NotNull
    @Column(name = "date_reg", nullable = false)
    @Temporal(TemporalType.DATE)
    private Date dateReg;
    @Basic(optional = false)
    @NotNull
    @Column(name = "lib_reg", nullable = false)
    private int libReg;
    @Basic(optional = false)
    @NotNull
    @Column(name = "cap_reg", nullable = false)
    private int capReg;
    @Basic(optional = false)
    @NotNull
    @Column(name = "ver_reg", nullable = false)
    private int verReg;
    @Basic(optional = false)
    @NotNull
    @Column(name = "capl_reg", nullable = false)
    private int caplReg;
    @Basic(optional = false)
    @NotNull
    @Column(name = "verl_reg", nullable = false)
    private int verlReg;
    @Basic(optional = false)
    @NotNull
    @Column(name = "libl_reg", nullable = false)
    private int liblReg;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "nom_usr", nullable = false, length = 50)
    private String nomUsr;

    public Reg() {
    }

    public Reg(Integer idReg) {
        this.idReg = idReg;
    }

    public Reg(Integer idReg, Date dateReg, int libReg, int capReg, int verReg, int caplReg, int verlReg, int liblReg, String nomUsr) {
        this.idReg = idReg;
        this.dateReg = dateReg;
        this.libReg = libReg;
        this.capReg = capReg;
        this.verReg = verReg;
        this.caplReg = caplReg;
        this.verlReg = verlReg;
        this.liblReg = liblReg;
        this.nomUsr = nomUsr;
    }

    public Integer getIdReg() {
        return idReg;
    }

    public void setIdReg(Integer idReg) {
        this.idReg = idReg;
    }

    public Date getDateReg() {
        return dateReg;
    }

    public void setDateReg(Date dateReg) {
        this.dateReg = dateReg;
    }

    public int getLibReg() {
        return libReg;
    }

    public void setLibReg(int libReg) {
        this.libReg = libReg;
    }

    public int getCapReg() {
        return capReg;
    }

    public void setCapReg(int capReg) {
        this.capReg = capReg;
    }

    public int getVerReg() {
        return verReg;
    }

    public void setVerReg(int verReg) {
        this.verReg = verReg;
    }

    public int getCaplReg() {
        return caplReg;
    }

    public void setCaplReg(int caplReg) {
        this.caplReg = caplReg;
    }

    public int getVerlReg() {
        return verlReg;
    }

    public void setVerlReg(int verlReg) {
        this.verlReg = verlReg;
    }

    public int getLiblReg() {
        return liblReg;
    }

    public void setLiblReg(int liblReg) {
        this.liblReg = liblReg;
    }

    public String getNomUsr() {
        return nomUsr;
    }

    public void setNomUsr(String nomUsr) {
        this.nomUsr = nomUsr;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idReg != null ? idReg.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Reg)) {
            return false;
        }
        Reg other = (Reg) object;
        if ((this.idReg == null && other.idReg != null) || (this.idReg != null && !this.idReg.equals(other.idReg))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entidades.Reg[ idReg=" + idReg + " ]";
    }
    
}
